package com.sjzsqjy.asdtiang.util;


public class MyConverter {
	private static MyConverter myConverter;
	private StringBuffer str;
	private char[] ch;
	private MyConverter() {}
	public static MyConverter getMyConverter() {
		if (myConverter == null) {
			myConverter = new MyConverter();
		}
		return myConverter;
	}
	public String converter(String str3) {
		if(str3==null){
			return "";//字符串为空返回
		}
		str=new StringBuffer();
		str.append("");
		ch=str3.toCharArray();
		for (int i = 0; i < ch.length; i++) {			
			if(ch[i]=='&'){
				if(ch[i+1]=='#')
				{				
					str.append(Character.toChars(Integer.parseInt(new String(ch,i+2,5))));
					i+=7;
				}
				else{
					str.append(ch[i]);
				}
			}
			else{
				str.append(ch[i]);
			}	
		}
		return str.toString();
	}
}
